<?php
Import_Class('json');

if($act=="edit")
{
    $sql_select = "SELECT * FROM tblcategory WHERE iId = ".$id;
    $rs=$dbsql->query($sql_select);
    if ($dbsql->num_rows($rs)==0)
    {
        page_transfer("Category not Exists!");
    }
    $category = $dbsql->fetch_array($rs);
    
    $ArrIntro   = FJSON::decode($category['cIntro'],true);
    //echo $category['cIntro'];exit;
   // var_dump($ArrIntro);
    if(count($ArrIntro)>0)
    {
        $category['cIntro'] = $ArrIntro['intro'];
        $category['cIntro2']= $ArrIntro['intro2'];
    }

    Select_Tag($id,'Category%');
}else
{
    $category   = array();
    $category['iParentId']  = $id;
    $category['iStatus']    = 1;
    $id                     = 0;
}
?>
